Update
Questions and Answers
Extensions for Silicon Graphics OpenGL Library for Windows
At SIGGRAPH '97, Silicon Graphics announced that they will release a driver kit for OpenGL. Click here for more information .
However, many developers did not understand that Cosmo OpenGL was a fully compliant OpenGL implementation tuned for a wide range of applications, including games. Changing the name to "OpenGL for Windows from Silicon Graphics" will help developers understand that any OpenGL application, whether related to the other Cosmo products or not, can take advantage of this implementation on PC platforms.
Note that the DLL names were changed also. The OpenGL library DLL is called OPENGL.DLL (it was previously named COSMOGL.DLL) and the GLU library DLL is called GLU.DLL (it was previously named COSMOGLU.DLL). You will need to relink your application to take advantage of the new DLLs.
SGI's OpenGL library implementation for Windows, features optimizations that PCs require for rendering Web and games-oriented 3D applications efficiently.
The optimizations include:
Silicon Graphics has made a substantial commitment to creating Web Products - the Cosmo suite of authoring and development tools and Cosmo Player, a VRML browser. SGI's OpenGL library ensures that applications perform well when the target platform is an unaccelerated Windows PC or a PC with MMX acceleration.
One of OpenGL's design goals was to make image quality a priority. It was developed in an environment that expected reasonable system performance. OpenGL's design is very well suited for today's PC capabilities.
As a result, SGI's OpenGL library for Windows delivers high performance without exhibiting the annoying rendering artifacts found with other APIs.
The poor reputation that OpenGL has found in the low-end PC market was due to the lack of a well-tuned implementation. SGI's OpenGL library for Windows will improve this reputation greatly.
SGI had not applied its extensive 3D API knowledge to the PC platform previously. SGI's OpenGL library for Windows demonstrates that high-end is a desirable quality and that it is not synonymous with being slow.
SGI's OpenGL library for Windows passes the OpenGL conformance tests. This assures developers that it provides a defined minimum level of image quality.
Although SGI's library is faster for triangle rendering, Microsoft's library renders points and lines faster. Also, Microsoft has done an excellent job of creating an environment that allows 3D graphics hardware vendors to accelerate OpenGL on Windows 95 and Windows NT. Microsoft supports two driver models for OpenGL: the installable client driver (ICD) which works on both Windows 95 and Windows NT and the mini client driver (MCD) which works on Windows NT only. Click here for more information on OpenGL from Microsoft.
We have been very careful to make sure that both SGI's OpenGL library and Microsoft's OpenGL library will coexist on the same PC.
If exact two-dimensional rasterization is desired, you must carefully specify the orthographic projection matrix, as detailed on the web site given above. You must also carefully specify the vertices of primitves that are to be rasterized. If the orthographic projection is specified as gluOrtho2D(0, width, 0, height) (where width and height are the viewport dimensions), then polygon vertices and pixel image positions need to be placed at integer coordinates to rasterize predictably. For example, glRecti(0, 0, 1, 1) reliably fills the lower left pixel of the viewport, and glRasterPos2i(0, 0) reliably positions an unzoomed image at the lower left of the viewport. Point vertices, line vertices and bitmap positions should be placed at half-integer locations, however. For example, a line drawn from (x1, 0.5) to (x2, 0.5) will be reliably rendered along the bottom row of pixels into the veiwport, and a point drawn at (0.5, 0.5) will reliably fill the same pixel as glRecti(0, 0, 1, 1).
If you want to specify all primitives at integer postions, while still ensuring predictable rasterization, then you can simply translate x and y by 0.375. That is, instead of setting the model-view matrix to identity, load a translation matrix that translates 0.375 in x and y.
As mentioned above, the performance for SGI's OpenGL library is achieved through a combination of tuning and new extensions. The first six of the following seven OpenGL extensions were developed specifically for SGI's OpenGL library for Windows. The seventh, EXT_paletted_texture, was previously introduced as a standard OpenGL extension by Microsoft.
This extension increases the number of packed vertex formats accepted by InterleavedArrays to include formats which specify color indexes rather than RGBA colors.
This extension provides a way to discard fragments when a comparison between the fragment's index value and a reference index fails. This may be used similarly to the alpha test which is available in RGBA mode.
This extends color index lighting to include a way for the current index to contribute to the color index produced by lighting. This works much like ColorMaterial does for RGBA lighting by allowing one or more color index material properties to be attached to the current index.
The color index lighting formula is also modified so that the lit color index may be bitwise shifted in order to allow greater control when using lighting and fog together in color index mode.
This extension enhances the definition of texturing to include color index mode. This extension builds on the notion of texture images which have color index internal formats which was introduced in EXT_paletted_texture.
This extension also introduces a new texture environment function ADD which is useful for combining lighting and texturing in color index mode.
This extension defines an interface which allows static vertex array data to be cached or pre-compiled for more efficient rendering. This is useful for implementations which can cache the transformed results of array data for reuse by several DrawArrays, ArrayElement, or DrawElements commands. It is also useful for implementations which can transfer array data to fast memory for more efficient processing.
This extension introduces a method for culling vertexes in object space based on the value of the dot product between the normal at the vertex and a culling eye direction.
Culling a polygon by examining its vertexes in object space can be more efficient than screen space polygon culling since the transformation to screen space (which may include a division by w) can be avoided for culled vertexes. Also, vertex culling can be computed before vertexes are assembled into primitives. This is a useful property when drawing meshes with shared vertexes, since a vertex can be culled once, and the resulting state can be used for all primitives which share the vertex.
This extension defines new texture formats and new calls to support the use of paletted textures in OpenGL. A paletted texture is defined by giving both a palette of colors and a set of image data which is composed of indices into the palette. The paletted texture cannot function properly without both pieces of information so it increases the work required to define a texture. This is offset by the fact that the overall amount of texture data can be reduced dramatically by factoring redundant information out of the logical view of the texture and placing it in the palette.
Paletted textures provide several advantages over full-color textures: As mentioned above, the amount of data required to define a texture can be greatly reduced over what would be needed for full-color specification. For example, consider a source texture that has only 256 distinct colors in a 256 by 256 pixel grid. Full-color representation requires three bytes per pixel, taking 192K of texture data. By putting the distinct colors in a palette only eight bits are required per pixel, reducing the 192K to 64K plus 768 bytes for the palette. Now add an alpha channel to the texture. The full-color representation increases by 64K while the paletted version would only increase by 256 bytes. This reduction in space required is particularly important for hardware accelerators where texture space is limited.
Paletted textures allow easy reuse of texture data for images which require many similar but slightly different colored objects. Consider a driving simulation with heavy traffic on the road. Many of the cars will be similar but with different color schemes. If full-color textures are used a separate texture would be needed for each color scheme, while paletted textures allow the same basic index data to be reused for each car, with a different palette to change the final colors.
Paletted textures also allow use of all the palette tricks developed for paletted displays. Simple animation can be done, along with strobing, glowing and other palette-cycling effects. All of these techniques can enhance the visual richness of a scene with very little data.
We welcome feedback and comments at win-opengl@sgi.com.